package education;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class ScoreCalculator {
	int mathScore;
	int physicsScore;
	int yuwenScore;
	Map<String,Integer> scores = new HashMap<String,Integer>();
	public void addCourseSctore(String cname ,int score) {
		scores.put(cname, score);
		
	}
	
	public int total() {
		int sum = 0;
		Set<String> keys = scores.keySet();
		for(String key : keys) {
			int score = scores.get(key);
			sum += score;
		}
		return sum;
	}
	public int average() {
		int sum = total();
		return sum/scores.size();
		
	}
}
